package com.feri.rbacsys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.feri.rbacsys.bo.GiftDetailBo;
import com.feri.rbacsys.entity.Gift;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * (Gift)表数据库访问层
 *
 * @author makejava
 * @since 2023-03-27 21:00:20
 */
public interface GiftDao extends BaseMapper<Gift> {

    /**
     * 查询赠品详情
     * @param id
     * @return
     */
    @Select("select tg.id,tp.name,tg.num from t_gift tg\n" +
            "left join t_product tp\n" +
            "on tp.id=tg.pid\n" +
            "where tg.id=#{id}")
    List<GiftDetailBo> selectGiftDetail(int id);

}

